1. Field of the Invention
The present invention relates to an editing apparatus for editing a sequence program used to control an automatic machine such as a machine tool or robot and, more particularly, to a sequence program editing apparatus with improved operability in replacement of a plurality of signal addresses referred to in a sequence program.
2. Description of the Related Art
As is well known, signal addresses are generally referred to in a sequence program used to control an automatic machine such as a machine tool or robot. Events such as a change in a part of a system including an automatic machine and the addition of a part to the system may necessitate changing all or some of the signal addresses. In such a case, replacement of the signal addresses is conventionally performed by editing work including a repetition of the following procedure using an editing program:
(1) Specify one of a plurality of signal addresses desired to be replaced (signal addresses to be replaced) and specify one after-replacement signal address for the specified signal address (the first specification).
(2) Search the sequence program for all the specified replacement target signal address (the first search).
(3) Replace the searched signal address with the after-replacement signal address specified in association with the searched address (the first replacement).
(4) Specify another one of the plurality of signal addresses to be replaced and specify one after-replacement signal address for the specified signal address (the second specification).
(5) Search the sequence program for all the specified replacement target signal address (the second search).
(6) Replace the searched signal address with the after-replacement signal address specified in association with the searched address (the second replacement).
(7) Repeat specification, search, and replacement steps (the third specification, search, and replacement steps, the fourth specification, search, and replacement steps, . . . ) until there is no more replacement target signal address.
As for search and replacement steps of the procedure, an operator only needs to enter an instruction by means of an operation key or the like. The steps are automatically performed by the function of the editing program. However, the operation involves several iterations of address specification and several iterations of entry of an instruction to execute search and replacement and takes time. In a replacement step as described above, if a set of signal addresses to be replaced and a set of after-replacement signal addresses have a common element (the same signal address), unintentional replacement may occur.
A simple example of such a case is replacement in which two signal addresses are interchanged. For example, assume that to replace signal addresses of A1 and A2 with the signal addresses of A2 and A1, respectively, replacement “A1→A2” is first executed, and then, replacement “A2→A1” is executed. In this case, the final version of the sequence program does not contain the address of A2 (which has once appeared but then disappeared) but contains only the address of A1. To prevent such a situation, one of the signal addresses needs to be replaced with an unused signal address, which complicates the operation. If three or more signal addresses need to be interchanged, the operation becomes more complicated, and an operation mistake becomes more likely to occur.
An editing apparatus which stores a plurality of character strings to be replaced and replaces them with other ones is made known by Japanese Patent Application Laid-Open No. 4-39763. However, the text editing apparatus described in the above patent document is not intended to be applied to replacement of signal addresses in a sequence program used to control an automatic machine. Also, target character strings before replacement and those after replacement are registered for each character string, and it is impossible to register before-replacement signal addresses and after-replacement signal addresses by specifying the range of signal addresses. More specifically, the above patent document does not explain, e.g., a function of registering replacement of A1 with B11, replacement of A2 with B12, replacement of A3 with B13, . . . , replacement of A10 with B20 by specifying the range of signal addresses, such as inputting “A1→A10→B11-B20” and executing replacement in the lump.